package com.ft.oa.mapper.dev;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ft.oa.domain.dev.DevTask;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface DevTaskMapper extends BaseMapper<DevTask>  {

    @Select("select id as devAllocateId ,dev_allocate_name as devAllocateName from dev_allocate where approval_status = '1' ;")
    List<Map<Long,String>> queryDevAllocate();

    @Select("select project_number from exec_project where id in (\n" +
            "    select project_id\n" +
            "    from dev_need\n" +
            "    where issue_id = (select dev_need_issue_id from dev_allocate where id = ${devAllocateId})\n" +
            ")")
    String[] queryProjectNumbers(@Param("devAllocateId") Long devAllocateId);

}
